 $(document).ready(function() 
 {
 
 	if( $(".successfull") ) 
	{
		$(".successfull").delay(3200).fadeOut(3000);	
	}
 	
	if( $(".errorMsg") ) 
	{
		$(".errorMsg").delay(3200).fadeOut(3000);	
	}
	
	$(".class_datepicker").datepicker({dateFormat: 'yy-mm-dd'});
	$(".class_timepicker").timepicker();
	
	$('.delete_class').click(function(e) {
	 //e.preventDefault();
	});
	
 });
 
 
 function arrHasDuplicate( array ) {                          // finds any duplicate array elements using the fewest possible comparison
	var i, j, n;
	n=array.length;
                                                     // to ensure the fewest possible comparisons
	for (i=0; i<n; i++) {                        // outer loop uses each item i at 0 through n
		for (j=i+1; j<n; j++) {              // inner loop only compares items j at i+1 to n
			if (array[i]==array[j]) return true;
	}	}
	return false;
}

function intOnly(myfield, e, dec)
{
	var key;
	var keychar;
	
	if (window.event)
	   key = window.event.keyCode;
	else if (e)
	   key = e.which;
	else
	   return true;
	keychar = String.fromCharCode(key);
	
	e = e || window.event; 
	if (e.ctrlKey && (("vV").indexOf(keychar) > -1))
	{
		return true;
	}
	
	if ((key==null) || (key==0) || (key==8) || (key==9) || (key==13) || (key==27) )
	{   
		return true; 
	}

	else if ((("0123456789").indexOf(keychar) > -1))
	{
	   return true;
	}  
	
	return false;
}

function confirm_delete(url)
{
	var agree = confirm("Are you sure you want to delete this record?");
	if (agree)
	{
		 location.href = encodeURI(url);
	}
	else
	{
		return false;
	}
}
